<{include file="common/header.tpl"}>
		<{$message}>
    	<h2 class="title01"><span>新增管理员</span></h2>
		<div>
			<form action="/user/add_admin" method="post" name="frm" id="frm">
			<input type="hidden" name="action" value="">
            <ul class="clear">
            <li class="i1"><span class="red">*</span> 账　　号：</li>
            <li><span class="in"><input type="text" name="login_name" class="in2" onblur="this.className='in2'" onfocus="this.className='in1'" value="" style="width:177px;" /></span></li>
            </ul>
            <ul class="clear">
            <li class="i1"><span class="red">*</span> 姓　　名：</li>
            <li><span class="in"><input type="text" name="realname" class="in2" onblur="this.className='in2'" onfocus="this.className='in1'" value="" style="width:177px;" /></span></li>
            </ul>
            <ul class="clear">
            <li class="i1"><span class="red">*</span> 角　　色：</li>
            <li><span class="in">           
			<select class="in2" name="role_name" onblur="this.className='in2'" onfocus="this.className='in1'" style="width:177px;" >
				<option value="3">项目主管</option>
				<option value="2">推广主管</option>
				<option value="21">财务专员</option>
				<option value="24">超级管理员</option>	
			</select>
			</span></li> 
			</ul>
            <ul class="clear">
            <li class="i1">手　　机：</li>
            <li><input type="text" class="in2" name="mobile" onblur="this.className='in2'" onfocus="this.className='in1'" value="" style="width:177px;" /></li>
            </ul>
            <ul class="clear">
            <li class="i1">处理任务权限：</li>
            <li>
			<input type="radio" class="in2" name="task_priviliage" onblur="this.className='in2'" onfocus="this.className='in1'" value="16" /> 创建任务 <br/>
			<input type="radio" class="in2" name="task_priviliage" onblur="this.className='in2'" onfocus="this.className='in1'" value="48" /> 任务运营 <br/>
			</li>
            </ul>

			<div class="line margin25"></div>
            <ul class="clear">
            <li class="i1">&nbsp;</li>
            <li>
            	<input type="submit" class="btn04" value="确　定"/>　<input type="reset" class="btn04" value="取　消" />
            </li>
            </ul>
			</form>
        </div>

<script type="text/javascript">
var frm = document.getElementById('frm');
frm.onsubmit = function ()
{
	with(this)
	{
		if(login_name.value == '')
		{
			ymPrompt.errorInfo('请填写帐号',null,null,'错误提示',function(){ymPrompt.close();login_name.focus();});
			return false;
		}
		if(realname.value == '')
		{
			ymPrompt.errorInfo('请填写姓名',null,null,'错误提示',function(){ymPrompt.close();realname.focus();});
			return false;
		}
		action.value = 'add';
	}
	return true;
}
function errMsg(msg)
{
	if(ymPrompt)
		ymPrompt.errorInfo(msg,null,null,'错误提示',function(){ymPrompt.close();frm.login_name.focus();});
}
function admin_tuan(obj)
{
	if(obj.checked)
	{
		$('#admin_group').show();
	}
	else
	{
		$('#city_selected').html('');
		$('.city_chk:checked').each(function(){
			this.checked = false;
		});
		$('#admin_group').hide();
	}
}
if($('.city_chk'))
{
$('.city_chk').hover(
	function (){
		$(this).css('cursor','pointer');
		var id = 'span_' + $(this).attr('name').substr(4);
		if($('#'+id))
		{
			$('#'+id).css('background-color','#00A100');
			$('#'+id).css('color','#FFFFFF');
		}
	},
	function (){
		$(this).css('cursor','auto');
		var id = 'span_' + $(this).attr('name').substr(4);
		if($('#'+id))
		{
			$('#'+id).css('background-color','#FFFFFF');
			$('#'+id).css('color','#333333');
		}
	}
);
$('.city_chk').click(function(){
	var id = 'span_' + $(this).attr('name').substr(4);
	var arr = id.split('_');
	var city_id = 'city_'+arr[1];
	var channel_id = 'channel_'+arr[2];
	var text = $('#'+city_id).text() + $('#'+channel_id).text();
	if($(this).attr('checked'))
	{
		$('#city_selected').append($('<span id="'+id+'">'+text+'</span>'));
	}else{
		$('#'+id).remove();
	}
});
}
</script>
<{include file="common/footer.tpl"}>
